package repository

import (
	"context"
	"jk-webook/internal/repository/cache"
)

type CodeRepository struct {
	cache *cache.CodeCache
}

func NewCodeRepository(cache *cache.CodeCache) *CodeRepository {
	return &CodeRepository{
		cache: cache,
	}
}
func (r *CodeRepository) Store(ctx context.Context, biz, phone string, code string) error {
	return r.cache.Set(ctx, biz, phone, code)
}
func (r *CodeRepository) Verify(ctx context.Context, biz, phone string, inputCode string) error {
	return r.cache.Verify(ctx, biz, phone, inputCode)
}
